package com.gec.system.util;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;


import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class AliClientTest {


    public static void main(String[] args) throws FileNotFoundException {
        String endpoint = "http://oss-cn-guangzhou.aliyuncs.com";
        // 秘钥

        String accessKeyId = "LTAI5t8CoCwFA1hqUarpifcc";
        String accessKeySecret = "laz3acznSSKwlrU8NtghW4gA19VgAQ";

        //创建oss客户端
        OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);

        // 上传文件
        // 上传文件windows.jpg

        InputStream inputStream = new FileInputStream("E:\\BaiduNetdiskDownload\\408\\《计算机组成原理》\\1.webp");

        ossClient.putObject("love-watch-moive", "1.jpg", inputStream);


        // 关闭OSSClient。
        ossClient.shutdown();
    }

}
